<?php

namespace App\Support;

class Response
{
    static function create($code, $msg, $data = null)
    {
        $result = [
            'code' => $code,
            'msg' => $msg,
        ];
        if ($data) {
            $result['data'] = $data;
        }
        return response()->json($result);
    }
}
